package cn.cjxy.orm.utils;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;


public class JdbcUtils {
	private static DataSource dataSource = new ComboPooledDataSource();

	public static DataSource getDataSource() {
		return dataSource;
	}

	public static Connection getConnection(){
		Connection con=null;
		try {
		    con=dataSource.getConnection();
		} catch (SQLException e){
			e.printStackTrace();
			return null;
		}
		
		return con;	
	}
}
